﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Parts_TabBox : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            NhaKinhDoanhDataContext db = new NhaKinhDoanhDataContext();
            Session["NoiBats"] = (from sp in db.TaiLieus
                                  where sp.Feature == 1 && sp.State != -1
                                  orderby sp.DateAdd descending
                                  select sp).Take(10).ToList<TaiLieu>();

            Session["MoiNhats"] = (from sp in db.TaiLieus
                                   where sp.State != -1
                                   orderby sp.DateAdd descending
                                   select sp).Take(10).ToList<TaiLieu>();

            Session["MuaNhieus"] = (from sp in db.TaiLieus
                                    where sp.State != -1
                                    orderby sp.NumsBuy descending
                                    select sp).Take(10).ToList<TaiLieu>();

            Session["XemNhieus"] = (from sp in db.TaiLieus
                                    where sp.State != -1
                                    orderby sp.NumsView descending
                                    select sp).Take(10).ToList<TaiLieu>();
        }
    }
}